package com.ybxx.fees.service.impl;

import java.util.List;

import com.ybxx.base.model.Residents;
import com.ybxx.base.model.Room;
import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.fees.dao.WsfRecordDao;
import com.ybxx.fees.model.AnmeterRecords;
import com.ybxx.fees.model.WsfRecord;
import com.ybxx.fees.service.WsfRecordService;

public class WsfRecordServiceImpl extends BaseServiceImpl<WsfRecord> implements
		WsfRecordService {
	private WsfRecordDao dao;
	public WsfRecordServiceImpl(WsfRecordDao dao) {
		super(dao);
		this.dao=dao;
		// TODO Auto-generated constructor stub
	}
	public WsfRecord generator(Room room,Residents residents,String ymonth){
		WsfRecord wsfRecord=new WsfRecord();
		String sql="select cid,ft.ftid,price,"+residents.getRnum()+"*price fees,"+residents.getRnum()+" rnum " +
				"from tbl_base_fees f,tbl_base_fees_item fi,tbl_base_fees_type ft " +
				"where f.fid=fi.fid and ft.ftid=ft.ftid and f.cid='"+room.getUnit().getBan().getCommunity().getCid()+"'";
		wsfRecord=dao.generator(sql);
		
		return wsfRecord;
	}

}
